<div id="app" >
  <div class="p2 flex">
    <a href="javascript:history.go(-1)" class="weui-btn weui-btn_mini weui-btn_default"> 返回 </a>
    <div style="flex: 1"></div>
  </div>


      <div style="color:#9C8484" class="flex items-center font-13">
          <div class="p2" style="flex: 1;">积分记录</div>
          <div class="p2">积分变动</div>
        </div>

        <div v-for="log in pointLogs" class="flex items-center">
          <div class="p2" style="flex: 1;">
            <div class="font-14 bold">
              {{log.desc}}
            </div>
            <div class="gray font-12">
              {{log.createTime}}
            </div>
          </div>
          <div class="p2 flex items-center" v-bind:class="{red:log.point>0, green: log.point<0}">
            <img src="/img/red/coin.png" style="width:18px;height:18px;"/>
            <div class="font-18 bold right-align" style="width: 40px;"> 
              {{log.point}}
            </div>
          </div> 
        </div>


  <div v-if="pointLogs.length==0" class="gray my2 center">
    <img src="/img/empty.png" style="width: 150px" />
    <div class="font-12 bold">没有更多数据了</div>
  </div>
</div>

<div class="p2 font-12 gray center">到底了~</div>
</div>



<script>
  new Vue({
    el: "#app",
    data: {
      pointLogs: [],
    },
    created: function () {
      this.getPointLogs(0);
    },
    methods: {
      getPointLogs: function () {
        let that = this;
        axios.get("/user/client/<%=clientid%>/pointlogs").then(function (res) {
          that.pointLogs = res.data.pointLogs;
        });
      },
    },
  });
</script>
